package cn.itcast.user.controller;

import cn.itcast.hmall.pojo.user.User;
import cn.itcast.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class FindUserController {
    @Autowired
    private UserService userService;
    @GetMapping("/{id}")
    public User findUserById(@PathVariable("id") String id){
        return  userService.findUserById(id);
    }
    @GetMapping("/{userId}/{totalFee}")
    Boolean balanceOfBuckle(@PathVariable("userId") Long userId, @PathVariable("totalFee") Long totalFee){
        return userService.balanceOfBuckle(userId,totalFee);
    }
}
